<template>
	<view>
		<nodata v-if="dataList.length==0"></nodata>

		<uni-card v-else @click="detail(item.fId,item.fCheckstatus)" v-for="(item,index) in dataList" :key="index">
			<view class="samplename" :style="{'background':item.fWarninglevel==0?'rgb(0, 192, 81)':item.fWarninglevel==1?'rgb(11, 183, 255)':item.fWarninglevel==2?'rgb(252, 232, 0)':item.fWarninglevel==3?'rgb(255, 140, 27)':'rgb(243, 39, 53)'}">
				<view>{{item[config[0].prop]}}</view>
				<view>{{item[config[1].prop]}}</view>
				
			</view>
			
			<view class="row" v-if="config[2]">
				<view class="nameInfo">{{config[2].label}}:</view>
				<view  class="contentInfo">{{item[config[2].prop]}}</view>
				
			</view>
			
			 <view class="row" v-if="config[3]">
				<view class="nameInfo">{{config[3].label}}:</view>
				<view class="contentInfo">{{item[config[3].prop]}}</view>
			</view>
			<view class="row" v-if="config[4]">
				<view class="nameInfo">{{config[4].label}}:</view>
				<view class="contentInfo">{{item[config[4].prop]}}</view>
			</view>
			
			<view class="row" v-if="config[5]">
				<view class="nameInfo">{{config[5].label}}:</view>
				<view class="contentInfo">{{item[config[5].prop]}}</view>
			</view>
			<view class="row" v-if="config[6]">
				<view class="nameInfo">{{config[6].label}}:</view>
				<view class="contentInfo">{{item[config[6].prop]}}</view>
			</view>

		</uni-card>
	</view>
</template>
<script>
	import nodata from '@/components/nodata/nodata.vue';
	export default {
		props: {
			dataList: {
				type: Array,
				default: function() {
					return []
				}
			},
			config: {
				type: Array,
				default: function() {
					return []
				}
			},
			Inv: {
				type: [String, Number],
				default: 0
			},
			backgroundColors: {
				type: String,
				default: 0
			}

		},
		data() {
			return {
				dataNum: this.Inv
			}
		},
		watch: {
			Inv(e) {
				this.dataNum = e
			},
		},
		components: {
			nodata
		},
		methods: {
			detail(id,fCheckstatus) {
				var data = {
					id: id,
					Inv: this.dataNum,
					num:fCheckstatus
				}
				
				this.$emit('yj_viewForm', data)
			}
		}
	}
</script>
<style scoped>
	.nameInfo {
		color: #999999;
	}

	.contentInfo {
		color: #333
	}

	.samplename {
		color: #fff;
		font-size: 32upx;
		font-weight: 700;
		line-height: 66upx;
		letter-spacing: 2upx;
		font-family: Source Han Sans CN;
		padding: 0 24upx;
		margin-bottom: 24upx;
		font-family: Source Han Sans CN;
		background-color: #525EF9;
		display: flex;
		justify-content: space-between;
	}
</style>
